package com.jt.controller;/**
 * @Author 金帮嘉诚 @Date 2021-08-04 星期三 10:53
 */
/*本类用于测试*/

import com.jt.pojo.Rights;
import com.jt.service.RightsService;
import com.jt.vo.SysResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * 知识点
 */
@RestController
@CrossOrigin
@RequestMapping("/rights")
public class RightsController {
    @Autowired
    private RightsService rightsService;

    /*我的方法*/

    /**
     * 获取rights表
     */
    @GetMapping("/getRightsList")
    public SysResult getRightsList() {
        List<Rights> rightsList = rightsService.getRightsList();
        //因为表中一定会有结果 所以不用判断
        return SysResult.success(rightsList);
    }
}
